﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LS_CardInfoModeWebForm.aspx.cs" Inherits="Anke.SHManage.Web.Reports.LS_CardInfoModeWebForm" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>油卡基础信息流水表</title>
    <script src="../Content/EasyUI/jquery.js"></script>
    <script src="../Content/EasyUI/jquery.easyui.js"></script>
    <script src="../Content/EasyUI/locale/easyui-lang-zh_CN.js"></script>
    <link href="../Content/EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="../Content/EasyUI/themes/default/easyui.css" rel="stylesheet" />
    <script src="../Scripts/jquery.AnkeExtend.js"></script>
</head>
     <script type="text/javascript">
        
         //页面初始化
         $(document).ready(function () {      
             initListcombo();    
             DisableBackspace();
         })
     //#region 为Combobox增加--请选择--
        function EUIcombobox(jqS, o) {
            $.ajax({
                type: "POST",
                async: false,
                url: o.url,
                dataType: "JSON",
                success: function (data1, textStatus, jqXHR) {
                    o.data = o.OneOption.concat(data1);
                    delete o.url;
                    delete o.OneOption;
                    $(jqS).combobox(o);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("获取字典数据失败！可能是已经超时，请重新登录！");
                }
            });
        }
        function initListcombo() {
            //取卡号
            $.EUIcombobox("#cardCode", {
                url: "../CM/CardInfo/GetCardCode/",
                valueField: 'ID',
                textField: 'Name',
                editable: true,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]
            });
            //取分中心
            EUIcombobox("#centerID", {
                url: "../Medical/GetCenter/",
                valueField: 'ID',
                textField: 'Name',
                //prompt: '--请选择--',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }],
                onSelect: function (rec) {
                    var urlstation = "../Medical/GetStation?code=" + rec.ID;
                    EUIcombobox("#stationID", {
                        url: urlstation,
                        valueField: 'ID',
                        textField: 'Name',
                        //prompt: '--请选择--',
                        editable: false,
                        OneOption: [{
                            ID: "",
                            Name: "--请选择--"
                        }]
                    });
                }
            });
            //#endregion
            //#region 出车分站
            EUIcombobox("#stationID", {
                url: "../Medical/GetStation?code=",
                valueField: 'ID',
                textField: 'Name',
                //prompt: '--请选择--',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]
            })
            //绑定工号和姓名联动
            $.EUIcombobox("#driverWorkID", {
                //prompt: '--请选择--',
                url: "../CM/CardInfo/GetWorkID/",
                valueField: 'ID',
                textField: 'Name',
                method: 'POST',
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }],
                onSelect: function (rec) {
                    $.ajax({
                        type: 'POST',
                        url: "../CM/CardInfo/GetListByWorkID",
                        data:
                            {
                                workID: rec.Name
                            },
                        dataType: "json",
                        success: function (jsData) {
                            $('#driverName').combobox("setText", jsData.model.DriverName);
                        }
                    });
                },
                onChange: function () {
                    $('#driverName').combobox('clear');
                }
            });

            //取绑定姓名
            $.EUIcombobox("#driverName", {
                url: "../CM/CardInfo/GetDriverNames/",
                valueField: 'ID',
                textField: 'Name',
                editable: true,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }]
            });
            //是否有效
            $('#IsActive').combobox({
                valueField: 'ID',
                textField: 'Name',
                method: 'post',
                editable: false,
                panelHeight: 'auto',
                data: [
                {
                    ID: '-1',
                    Name: '--请选择--',
                },
                {
                    ID: '1',
                    Name: '是'
                },
                {
                    ID: '0',
                    Name: '否'
                }
                ],
                onSelect: function () {
                    $('#HiddenForIsActive').val($('#IsActive').combobox('getValue'));
                },
                onLoadSuccess: function () {
                    var dataz = $('#IsActive').combobox('getData');
                    $("#IsActive").combobox('select', dataz[0].ID);
                }
            })

            //是否翻班
            $('#IsFanBan').combobox({
                valueField: 'ID',
                textField: 'Name',
                method: 'post',
                editable: false,
                panelHeight: 'auto',
                data: [
                {
                    ID: '-1',
                    Name: '--请选择--',
                },
                {
                    ID: '1',
                    Name: '是'
                },
                {
                    ID: '0',
                    Name: '否'
                }
                ],
                onSelect: function () {
                    $('#HiddenForIsFanBan').val($('#IsFanBan').combobox('getValue'));
                },
                onLoadSuccess: function () {
                    var dataz = $('#IsFanBan').combobox('getData');
                    $("#IsFanBan").combobox('select', dataz[0].ID);
                }
            })
        }
  
    </script>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
            <table>                                          
                <tr>                 
                    <td style="width: 8%; text-align: right">分中心：</td>
                    <td style="width: 12%">
                        <asp:TextBox ID="centerID" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 8%; text-align: right">分站：</td>
                    <td style="width: 12%">
                         <asp:TextBox ID="stationID" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>                  
                    </td>   
                     <td style="width: 10%; text-align: right">油卡负责人工号：</td>
                    <td style="width: 12%">
                        <asp:TextBox ID="driverWorkID" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 10%; text-align: right">油卡负责人姓名：</td>
                    <td style="width: 12%">
                         <asp:TextBox ID="driverName" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>                  
                    </td>   
                </tr>
                <tr>                 
                    <td style="width: 8%; text-align: right">卡号：</td>
                    <td style="width: 12%">
                        <asp:TextBox ID="cardCode" class="easyui-combobox" Style="width: 150px" runat="server"></asp:TextBox>
                    </td>
                    <td style="width: 8%; text-align: right">是否有效：</td>
                    <td style="width: 12%">
                         <asp:HiddenField ID="HiddenForIsActive" runat="server" />
                        <select id="IsActive" class="easyui-combobox" style="width: 150px" data-options="editable:false">                                                 
                        </select>                                         
                    </td>   
                    <td style="width: 8%; text-align: right">是否翻班：</td>
                    <td style="width: 12%">
                          <asp:HiddenField ID="HiddenForIsFanBan" runat="server" />
                        <select id="IsFanBan" class="easyui-combobox" style="width: 150px" data-options="editable:false">                                                 
                        </select>                                        
                    </td>
                    <td></td>
                    <td></td>   
                    <td>
                        <asp:Button ID="Button1" runat="server" Text="查询" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
            <div style="background-color: #fafafa; border-left: 1px solid scrollbar; overflow: hidden; height: 100%;">

                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%" Height="100%"  SizeToReportContent="True">
                </rsweb:ReportViewer>
            </div>
        </div>
    </form>
</body>
</html>

